cmake_minimum_required(VERSION 3.20)
project(app)


set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED on)
set(CMAKE_BUILD_TYPE Debug)
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0 -Wall -g -ggdb")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -O0 -Wall -g -ggdb")


##定義可執行文件、頭文件、庫文件路徑

set(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/bin)##制定二進制文件輸出路徑
set(HEADER_PATH ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/include) ##本地頭文件
set(LIB_PATH ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/lib)  ##本地庫路徑


##加载头文件
include_directories(/usr/include)
include_directories(${CMAKE_SOURCE_DIR}/include)
include_directories(${CMAKE_SOURCE_DIR}/include/detect)
include_directories(${CMAKE_SOURCE_DIR}/include/track)
include_directories(${CMAKE_SOURCE_DIR}/include/common)
include_directories(${CMAKE_SOURCE_DIR}/include/correlation)
include_directories(${CMAKE_SOURCE_DIR}/include/hardware)
include_directories(${CMAKE_SOURCE_DIR}/include/net)


include_directories(${CMAKE_SOURCE_DIR}/thirdparty/include)
include_directories(${FFTW_INCLUDE_DIRS})


link_directories(${LIB_PATH})
 

##加载源文件
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/src TOPLAYER_SOURCE_LIST)
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/src/detect DETECT_SOURCE_LIST)
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/src/track TRACK_SOURCE_LIST)
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/src/common COMMON_SOURCE_LIST)
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/src/net NET_SOURCE_LIST)
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/src/hardware HARDWARE_SOURCE_LIST)
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/src/correlation CORRELATION_SOURCE_LIST)



set(SRC_LIST  ${TOPLAYER_SOURCE_LIST} ${DETECT_SOURCE_LIST} ${TRACK_SOURCE_LIST} ${COMMON_SOURCE_LIST} ${CORRELATION_SOURCE_LIST} ${NET_SOURCE_LIST} ${HARDWARE_SOURCE_LIST})




add_executable(app main.cc ${SRC_LIST})

target_link_libraries(app  fftw3f)# 显式链接单精度库)